package java0226;

import java.util.Scanner;

class Person{
	private String name;
	private boolean gender;
	private int age;
	private int id;
	public Person(){
		this.name=null;
		this.age=0;
		this.gender=false;
		this.id=0;
		System.out.println("This is constructor");
		System.out.println(this.name+","+this.age+","+this.gender+","+this.id);
	}
	public Person(String name,boolean gender,int age){
		this.name=name;
		this.gender=gender;
		this.age=age;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public boolean isGender() {
		return gender;
	}
	public void setGender(boolean gender) {
		this.gender = gender;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String toString(){
		return("Person "+"[name="+name+", age="+age+", gender="+gender+", id="+id+"]");
	}
}

public class Creative {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		Person[] person=new Person[n];
		String name;
		int age;
		boolean gender;
		for (int i = 0; i <n; i++) {
			name=sc.next();
			age=sc.nextInt();
			gender=sc.nextBoolean();
			person[i]=new Person(name,gender,age);
		}
		for (int i = person.length - 1; i >= 0; i--) {
			System.out.println(person[i]);
		}
		Person newper=new Person();
		System.out.println(newper);
		sc.close();
	}

}



